/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.core.ui.dialogs;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.AggregationKind;

import com.cea.papyrus.core.utils.Debug;


/**
 * 
 */
public class ChooseAggregationKindDialog extends ChooseDialog implements IChooseDialog{
	
/**
 * 
 * 
 * @param parentShell 
 */
public ChooseAggregationKindDialog(Shell parentShell){
		
		super(parentShell);
		
		announce="Choose your visibility:";
		
		
		elementList =new  String[3];
		elementList[0]= AggregationKind.COMPOSITE_LITERAL.toString();
		elementList[1]= AggregationKind.NONE_LITERAL.toString();
		elementList[2]= AggregationKind.SHARED_LITERAL.toString();
		

	}
	
	/**
	 * 
	 * 
	 * @param parent 
	 * 
	 * @return 
	 */
	@Override
	protected Control createDialogArea(Composite parent){
		Composite comp=(Composite)super.createDialogArea(parent);
		return comp;
	}
	
	/**
	 * 
	 * 
	 * @param parent 
	 */
	@Override
	protected void createButtonsForButtonBar(Composite parent){
		super.createButtonsForButtonBar(parent);
		
	}
	
	/**
	 * 
	 * 
	 * @param buttonId 
	 */
	@Override
	protected void buttonPressed(int buttonId){
		super.buttonPressed(buttonId);
	}
	
	/**
	 * 
	 */
	@Override
	protected void okPressed(){
		Debug.debug(this,"ChooseDialog.okPressed "+combo.getSelectionIndex(), channel);
		Debug.debug(this,"actrion...", channel);
		int i=combo.getSelectionIndex();
		switch(i){
			case 0:
				value=AggregationKind.COMPOSITE_LITERAL;
				break;
			case 1:
				value=AggregationKind.NONE_LITERAL;
				break;
			case 2:
				value=AggregationKind.SHARED_LITERAL;
				break;
			
		}
		super.okPressed();
	} 
	

}
